****************************************************************************************************************
*\/////////////////////////////////////
*
* REPLICATION CODE FOR "Environmental change and migration aspirations: Evidence from Bangladesh"
*
* by Lukas Rudolph, Vally Koubi and Jan Freihardt
*
* Global Environmental Change
*
*
**\/////////////////////////////////////
****************************************************************************************************************

****************************************************************************************************************
*\/////////////////////////////////////
*
*Code file generated: 2024-08 by Lukas Rudolph
*Data used: replication_data.dta
*Data output generated: --
*Tables generated: all Article and Online Appendix Tables reporting statistical analyses 
*Figutes generated: all Article and Online Appendix Figures reporting statistical analyses 
*
**\/////////////////////////////////////
****************************************************************************************************************

****************************************************************************************************************
*\/////////////////////////////////////
*
*Prepare Stata
*
*\/////////////////////////////////////
****************************************************************************************************************

********************************************************
*Set working directory to where data file lies
********************************************************

cd // enter working directory after "cd"


********************************************************
*Install packages if not already done
********************************************************

/*
ssc install grstyle
ssc install coefplot
ssc install estout
ssc install palettes
ssc install colrspace
ssc install ebalance
*/ 

********************************************************
*Set grstyle for nice graphs
********************************************************

grstyle init
grstyle set plain, horizontal grid
grstyle set color Dark2  
grstyle set legend 2, inside nobox

********************************************************
*define global macros used in later code
********************************************************

global sample = "Sample: HH that did and did not move within 6 months, i.e. recoding temporary and permanent migrants as having (realized) past/present aspirations. Entropy balancing weights and control variables used as indicated. Standard errors clustered by village. ** (***, *) indicates p < 0.05 (0.01, 0.10)."

global reduced_sample_text = "Sample: HH that did not move within 6 months, i.e. exluding temporary and permanent migrants, as well as households that 'shifted' within village. Entropy balancing weights and control variables used as indicated. Standard errors clustered by village. ** (***, *) indicates p < 0.05 (0.01, 0.10)."
 
global controls = "i.district i.zone i.sex i.age_cat i.kids_num i.education i.income_source1_coded attachment past_migration1 aspirations_past aspirations_present_all risk_pref land_size_total housing lsu fullequip"  
 
global se = "cluster(location)"

 
********************************************************
*load data
********************************************************
use replication_data.dta, clear


****************************************************************************************************************
*\/////////////////////////////////////
*
*Creation of variables and labeling of data
*
*\/////////////////////////////////////
****************************************************************************************************************

********************
*"imputation", i.e., setting aspirations of all migrants as "revealed aspirations", i.e., == 1

replace aspirations_present_overall = 1 if migrant == 1  
replace w6_aspirations_past = 1 if migrant == 1  

gen aspiration_choice = aspirations_present_overall
gen aspiration_thought = w6_aspirations_past

********************
*alternative dependent variable: aspirations of all households that shifted location within village set to 0
gen aspiration_choice_noshifters = aspiration_choice  
gen aspiration_thought_noshifters = aspiration_thought 
replace aspiration_choice_noshifters = 0 if asp_shift == 1
replace aspiration_thought_noshifters = 0 if asp_shift == 1 

********************
*alternative dependent variable: aspirations of all households that moved set to 0 (i.e., all households that migrated or shifted location within village set to 0). this is assessed via the "reduced_sample == 1" indicator
gen nonstayers = migrant
replace nonstayers = 1 if migrant == 0 & house_shifting_within_village == 1
gen reduced_sample = . 
replace reduced_sample = 1 if nonstayers != 1


********************
*define dependent variable capturing aspiration to move temporary or permanent or to move to urban or rural area

*- asp_duration: 1-temporary, 2-permanent 
*- asp_destination: 1-village, 2-city

replace asp_duration = 0 if aspiration_choice == 0 & aspiration_thought == 0
replace asp_destination = 0 if aspiration_choice == 0 & aspiration_thought == 0

label define destination 0 "stay" 1 "rural" 2 "urban"
label define duration 0 "stay" 1 "temporary" 2 "permanent"
label values asp_duration duration
label values asp_destination destination


********************
*define indicator for aspiration to shift house within village
gen shifting_aspiration = 0 if aspiration_choice != .
replace shifting_aspiration = 1 if asp_shift == 1


********************
*generate indicator variables from categorical variables for use in entropy balancing/summary table/balance test tables

tab erosion2021_impactcat, gen(erosion2021_impactcat_num)
tab flood2021_impactcat, gen(flood2021_impactcat_num)

tab asp_duration, gen(asp_duration_num)
tab asp_destination, gen(asp_destination_num)

********************
*indicator for self-reported loss of house (to compare to indicator for objectively lost house later on)
*binary
gen selfreported_loss_house = . 
replace selfreported_loss_house = 0 if erosion_relevant != . 
replace selfreported_loss_house = 1 if erosion2021_impact3 == "Loss of house"
replace selfreported_loss_house = 1 if erosion2021_impact2 == "Loss of house"
replace selfreported_loss_house = 1 if erosion2021_impact1 == "Loss of house"
*multi-categorical
gen impact_erosion = .
replace impact_erosion = 1 if house_lost == 1
replace impact_erosion = 2 if erosion2021_impactcat == 1 & house_lost != 1
replace impact_erosion = 3 if erosion2021_impactcat == 2 & house_lost != 1
replace impact_erosion = 4 if erosion2021_impactcat == 3 & house_lost != 1
replace impact_erosion = 5 if erosion2021_impactcat == 4 & house_lost != 1
replace impact_erosion = . if house_lost >= . | erosion2021_impactcat >= .
label define impact_erosion 1 "House lost from erosion (objective)" 2 "Else strong erosion impact (subj.)" 3 "Else some erosion impact (subj.)" 4 "Else some erosion impact (subj.)" 5 "Else no erosion impact (subj.)", replace
label values impact_erosion impact_erosion 


	
********************
*some labeling of variables
label variable erosion_relevant "Erosion affected"
label variable flood_relevant "Flood affected"
label variable house_shifting_within_village "House shifted"
label variable migrant "Migrant"

label variable erosion_village "Erosion: HH affected in %"
label variable flood_village "Flood: HH affected in %"
  
label variable asp_shift "Shifting aspiration"
label variable shifting_aspiration "Shifting aspiration"

label variable aspirations_past "past aspirations (in pre-monsoon survey)"
label variable aspirations_present_all "current aspirations (in pre-monsoon survey)"
label variable aspiration_thought "Aspiration (1 m)"
label variable aspiration_choice "Aspiration (now)"
label variable aspiration_thought_noshifters "Aspiration (1 m)"
label variable aspiration_choice_noshifters "Aspiration (now)"

label variable erosion2021_impactcat "erosion impact"
label variable flood2021_impactcat "floood impact"
	
	
	
****************************************************************************************************************
*\/////////////////////////////////////
*
*Creation of entropy balancing weights
*
*\/////////////////////////////////////
****************************************************************************************************************



********************
*Entropy balancing weights for imputed sample by self-reported affectedness

ebalance erosion_relevant flood_relevant $controls, gen(weight_erosion)
ebalance flood_relevant erosion_relevant $controls, gen(weight_flood)

********************
*Entropy balancing weights for imputed sample by objective affectedness (house lost)
 
ebalance house_lost  $controls, gen(weight_objective) // binary
ebalance house_lost  $controls if house_lost == 1 | erosion_relevant == 0, gen(weight_objectivev2) // multi-categorical


*****
*entropy balancing weights for imputed sample (i.e., aspirations of migrants set to 1) by self-reported erosion impact extent
****** 

*define impact category dummy variabels for entropy balancing
gen erosion2021_impactcat_1 = .
replace erosion2021_impactcat_1 = 0 if erosion2021_impactcat==4 
replace erosion2021_impactcat_1 = 1 if erosion2021_impactcat==1

gen erosion2021_impactcat_2 = .
replace erosion2021_impactcat_2 = 0 if erosion2021_impactcat==4
replace erosion2021_impactcat_2 = 1 if erosion2021_impactcat==2

gen erosion2021_impactcat_3 = .
replace erosion2021_impactcat_3 = 0 if erosion2021_impactcat==4 
replace erosion2021_impactcat_3 = 1 if erosion2021_impactcat==3

gen flood2021_impactcat_1 = .
replace flood2021_impactcat_1 = 0 if flood2021_impactcat==4 
replace flood2021_impactcat_1 = 1 if flood2021_impactcat==1

gen flood2021_impactcat_2 = .
replace flood2021_impactcat_2 = 0 if flood2021_impactcat==4 
replace flood2021_impactcat_2 = 1 if flood2021_impactcat==2

gen flood2021_impactcat_3 = .
replace flood2021_impactcat_3 = 0 if flood2021_impactcat==4 
replace flood2021_impactcat_3 = 1 if flood2021_impactcat==3

* weights for high impact category
ebalance erosion2021_impactcat_1 flood_relevant $controls if erosion2021_impactcat==4 | erosion2021_impactcat==1, gen(weight_erosion_cat1) 
ebalance flood2021_impactcat_1 erosion_relevant $controls if flood2021_impactcat==4 | flood2021_impactcat==1, gen(weight_flood_cat1) 

* weights for medium impact category
ebalance erosion2021_impactcat_2 flood_relevant $controls if erosion2021_impactcat==4 | erosion2021_impactcat==2, gen(weight_erosion_cat2) targets(3) 
ebalance flood2021_impactcat_2 erosion_relevant $controls if flood2021_impactcat==4 | flood2021_impactcat==2, gen(weight_flood_cat2) targets(3) 

* weights for low impact category
ebalance erosion2021_impactcat_3 flood_relevant $controls if erosion2021_impactcat==4 | erosion2021_impactcat==3, gen(weight_erosion_cat3) 
ebalance flood2021_impactcat_3 erosion_relevant $controls if flood2021_impactcat==4 | flood2021_impactcat==3, gen(weight_flood_cat3) 


*****
*entropy balancing weights for reduced sample (i.e., migrants and shifters within village excluded) by self-reported impact yes/no
*****
ebalance erosion_relevant flood_relevant $controls if reduced_sample==1, gen(rs_weight_erosion) 
ebalance flood_relevant erosion_relevant $controls if reduced_sample==1, gen(rs_weight_flood) 


*****
*entropy balancing weights for reduced sample (i.e., migrants and shifters within village excluded) by self-reported erosion impact extent
*****

* weights for high impact category
ebalance erosion2021_impactcat_1 flood_relevant $controls if reduced_sample == 1 & (erosion2021_impactcat==4 | erosion2021_impactcat==1), gen(rs_weight_erosion_cat1) 
ebalance flood2021_impactcat_1 erosion_relevant $controls if reduced_sample == 1 & (flood2021_impactcat==4 | flood2021_impactcat==1), gen(rs_weight_flood_cat1) 

* weights for medium impact category
ebalance erosion2021_impactcat_2 flood_relevant $controls if reduced_sample == 1 & (erosion2021_impactcat==4 | erosion2021_impactcat==2), gen(rs_weight_erosion_cat2) targets(2) 
ebalance flood2021_impactcat_2 erosion_relevant $controls if reduced_sample == 1 & (flood2021_impactcat==4 | flood2021_impactcat==2), gen(rs_weight_flood_cat2) targets(3) 

* weights for low impact category
ebalance erosion2021_impactcat_3 flood_relevant $controls if reduced_sample == 1 & (erosion2021_impactcat==4 | erosion2021_impactcat==3), gen(rs_weight_erosion_cat3) 
ebalance flood2021_impactcat_3 erosion_relevant $controls if reduced_sample == 1 & (flood2021_impactcat==4 | flood2021_impactcat==3), gen(rs_weight_flood_cat3) 


	
****************************************************************************************************************
*\/////////////////////////////////////
*
*Creation of main article Figures and Tables
*
*\/////////////////////////////////////
****************************************************************************************************************
*
*Figure 2, Current and last month's aspirations and affectedness
*
grstyle init
grstyle set imesh
grstyle set color hue, n(6) // 
grstyle set symbol
grstyle set legend, nobox
grstyle set legend 5, inside nobox

eststo clear 

foreach dv in aspiration_choice aspiration_thought {

eststo `dv'1: reg `dv' erosion_relevant flood_relevant  , $se
eststo `dv'2: reg `dv' erosion_relevant flood_relevant [pweight=weight_erosion], $se
eststo `dv'3: reg `dv' erosion_relevant flood_relevant [pweight=weight_flood], $se
eststo `dv'4: reg `dv' erosion_relevant flood_relevant $controls , $se
eststo `dv'5: reg `dv' erosion_relevant flood_relevant $controls [pweight=weight_erosion], $se
eststo `dv'6: reg `dv' erosion_relevant flood_relevant $controls [pweight=weight_flood], $se

}


coefplot ///
(aspiration_choice1,  keep(erosion_relevant flood_relevant)) ///
(aspiration_choice2,  keep(erosion_relevant)) ///
(aspiration_choice3,  keep(flood_relevant)) ///
(aspiration_choice4,  keep(erosion_relevant flood_relevant)) ///
(aspiration_choice5,  keep(erosion_relevant)) ///
(aspiration_choice6,  keep(flood_relevant)) ///
, bylabel("Aspirations (now)") ///
|| ///
(aspiration_thought1, label(No weights, no controls) keep (erosion_relevant flood_relevant)) ///
(aspiration_thought2, label(Erosion weights) keep (erosion_relevant)) ///
(aspiration_thought3, label (Flood weights) keep (flood_relevant)) ///
(aspiration_thought4, label(No weights, controls) keep (erosion_relevant flood_relevant)) ///
(aspiration_thought5, label(Erosion weights, controls) keep (erosion_relevant)) ///
(aspiration_thought6, label (Flood weights, controls) keep (flood_relevant)) ///
, bylabel("Aspirations (last month)") ///
 xline(0) label legend(rows(2) size(*0.7)) /// 
  // byopts(note("Sample: HH that did and did not move within 6 months, i.e. recoding temporary and permanent migrants" "as having (realized) past/present aspirations. Entropy balancing weights and control variables used as" "indicated. Standard errors clustered by village."))

*
*Table 1, : Last month's migration aspirations and erosion/flood affectednes
*
eststo clear

eststo: reg aspiration_thought ib4.erosion2021_impactcat ib4.flood2021_impactcat  , $se
estadd local Subgroup_weights_flood "No": est1
estadd local Subgroup_weights_erosion "No": est1
quietly sum aspiration_thought if erosion_relevant==0
estadd scalar control_mean = r(mean) : est1
estadd scalar control_sd = r(sd) : est1

eststo: reg aspiration_thought ib4.erosion2021_impactcat ib4.flood2021_impactcat $controls , $se
estadd local Subgroup_weights_flood "No": est2
estadd local Subgroup_weights_erosion "No": est2
quietly sum aspiration_thought if erosion_relevant==0
estadd scalar control_mean = r(mean) : est2
estadd scalar control_sd = r(sd) : est2

eststo: reg aspiration_thought ib4.erosion2021_impactcat flood_relevant $controls [pweight=weight_erosion_cat1], $se
estadd local Subgroup_weights_flood "No": est3
estadd local Subgroup_weights_erosion "Yes": est3
quietly sum aspiration_thought  [aweight=weight_erosion_cat1] if  erosion_relevant==0
estadd scalar control_mean = r(mean) : est3
estadd scalar control_sd = r(sd) : est3

eststo: reg aspiration_thought ib4.erosion2021_impactcat flood_relevant $controls [pweight=weight_erosion_cat2], $se
estadd local Subgroup_weights_flood "No": est4
estadd local Subgroup_weights_erosion "Yes": est4
quietly sum aspiration_thought  [aweight=weight_erosion_cat2] if  erosion_relevant==0
estadd scalar control_mean = r(mean) : est4
estadd scalar control_sd = r(sd) : est4

eststo: reg aspiration_thought ib4.erosion2021_impactcat flood_relevant $controls [pweight=weight_erosion_cat3], $se
estadd local Subgroup_weights_flood "No": est5
estadd local Subgroup_weights_erosion "Yes": est5
quietly sum aspiration_thought  [aweight=weight_flood_cat1] if erosion_relevant==0
estadd scalar control_mean = r(mean) : est5
estadd scalar control_sd = r(sd) : est5

eststo: reg aspiration_thought  ib4.flood2021_impactcat erosion_relevant $controls [pweight=weight_flood_cat1], $se
estadd local Subgroup_weights_flood "Yes": est6
estadd local Subgroup_weights_erosion "No": est6
quietly sum aspiration_thought [aweight=weight_flood_cat1] if flood_relevant==0
estadd scalar control_mean = r(mean) : est6
estadd scalar control_sd = r(sd) : est6

eststo: reg aspiration_thought  ib4.flood2021_impactcat erosion_relevant $controls [pweight=weight_flood_cat2], $se
estadd local Subgroup_weights_flood "Yes": est7
estadd local Subgroup_weights_erosion "No": est7
quietly sum aspiration_thought [aweight=weight_flood_cat2] if flood_relevant==0
estadd scalar control_mean = r(mean) : est7
estadd scalar control_sd = r(sd) : est7

eststo: reg aspiration_thought  ib4.flood2021_impactcat erosion_relevant $controls [pweight=weight_flood_cat3], $se
estadd local Subgroup_weights_flood "Yes": est8
estadd local Subgroup_weights_erosion "No": est8
quietly sum aspiration_thought [aweight=weight_flood_cat3] if flood_relevant==0
estadd scalar control_mean = r(mean) : est8
estadd scalar control_sd = r(sd) : est8

esttab, nonotes replace compress stats(N r2_a control_mean control_sd Subgroup_weights_flood Subgroup_weights_erosion, fmt(0 2)) b(2) se(2) star(* 0.10 ** 0.05 *** 0.01) label ///
keep(*erosion* *flood*) order(*erosion2021_impactcat) indicate( "Controls = 1.sex") ///
note("$sample") 

*
*Table 2, Current migration aspirations and erosion/flood affectedness 
*
eststo clear

eststo: reg aspiration_choice ib4.erosion2021_impactcat ib4.flood2021_impactcat  , $se
estadd local Subgroup_weights_flood "No": est1
estadd local Subgroup_weights_erosion "No": est1
quietly sum aspiration_choice if erosion_relevant==0
estadd scalar control_mean = r(mean) : est1
estadd scalar control_sd = r(sd) : est1

eststo: reg aspiration_choice ib4.erosion2021_impactcat ib4.flood2021_impactcat $controls , $se
estadd local Subgroup_weights_flood "No": est2
estadd local Subgroup_weights_erosion "No": est2
quietly sum aspiration_choice if erosion_relevant==0
estadd scalar control_mean = r(mean) : est2
estadd scalar control_sd = r(sd) : est2

eststo: reg aspiration_choice ib4.erosion2021_impactcat flood_relevant $controls [pweight=weight_erosion_cat1], $se
estadd local Subgroup_weights_flood "No": est3
estadd local Subgroup_weights_erosion "Yes": est3
quietly sum aspiration_choice  [aweight=weight_erosion_cat1] if  erosion_relevant==0
estadd scalar control_mean = r(mean) : est3
estadd scalar control_sd = r(sd) : est3

eststo: reg aspiration_choice ib4.erosion2021_impactcat flood_relevant $controls [pweight=weight_erosion_cat2], $se
estadd local Subgroup_weights_flood "No": est4
estadd local Subgroup_weights_erosion "Yes": est4
quietly sum aspiration_choice  [aweight=weight_erosion_cat2] if  erosion_relevant==0
estadd scalar control_mean = r(mean) : est4
estadd scalar control_sd = r(sd) : est4

eststo: reg aspiration_choice ib4.erosion2021_impactcat flood_relevant $controls [pweight=weight_erosion_cat3], $se
estadd local Subgroup_weights_flood "No": est5
estadd local Subgroup_weights_erosion "Yes": est5
quietly sum aspiration_choice  [aweight=weight_flood_cat1] if erosion_relevant==0
estadd scalar control_mean = r(mean) : est5
estadd scalar control_sd = r(sd) : est5

eststo: reg aspiration_choice  ib4.flood2021_impactcat erosion_relevant $controls [pweight=weight_flood_cat1], $se
estadd local Subgroup_weights_flood "Yes": est6
estadd local Subgroup_weights_erosion "No": est6
quietly sum aspiration_choice [aweight=weight_flood_cat1] if flood_relevant==0
estadd scalar control_mean = r(mean) : est6
estadd scalar control_sd = r(sd) : est6

eststo: reg aspiration_choice  ib4.flood2021_impactcat erosion_relevant $controls [pweight=weight_flood_cat2], $se
estadd local Subgroup_weights_flood "Yes": est7
estadd local Subgroup_weights_erosion "No": est7
quietly sum aspiration_choice [aweight=weight_flood_cat2] if flood_relevant==0
estadd scalar control_mean = r(mean) : est7
estadd scalar control_sd = r(sd) : est7

eststo: reg aspiration_choice  ib4.flood2021_impactcat erosion_relevant $controls [pweight=weight_flood_cat3], $se
estadd local Subgroup_weights_flood "Yes": est8
estadd local Subgroup_weights_erosion "No": est8
quietly sum aspiration_choice [aweight=weight_flood_cat3] if flood_relevant==0
estadd scalar control_mean = r(mean) : est8
estadd scalar control_sd = r(sd) : est8

esttab, nonotes replace compress stats(N r2_a control_mean control_sd Subgroup_weights_flood Subgroup_weights_erosion, fmt(0 2)) b(2) se(2) star(* 0.10 ** 0.05 *** 0.01) label ///
keep(*erosion* *flood*) order(*erosion2021_impactcat) indicate( "Controls = 1.sex") ///
note("$sample") 

*
*Table 3, Destination of migration aspirations 
*
eststo clear

eststo: mlogit asp_destination erosion_relevant flood_relevant  , $se
estadd local Weights_flood "No": est1
estadd local Weights_erosion "No": est1
quietly sum asp_destination if erosion_relevant==0
estadd scalar control_mean = r(mean) : est1
estadd scalar control_sd = r(sd) : est1

eststo: mlogit asp_destination erosion_relevant flood_relevant [pweight=weight_erosion], $se
estadd local Weights_flood "No": est2
estadd local Weights_erosion "Yes": est2
quietly sum asp_destination [aweight=weight_erosion] if erosion_relevant==0
estadd scalar control_mean = r(mean) : est2
estadd scalar control_sd = r(sd) : est2

eststo: mlogit asp_destination erosion_relevant flood_relevant [pweight=weight_flood], $se
estadd local Weights_flood "Yes": est3
estadd local Weights_erosion "No": est3
quietly sum asp_destination [aweight=weight_flood] if flood_relevant==0
estadd scalar control_mean = r(mean) : est3
estadd scalar control_sd = r(sd) : est3

eststo: mlogit asp_destination erosion_relevant flood_relevant $controls , $se
estadd local Weights_flood "No": est4
estadd local Weights_erosion "No": est4
quietly sum asp_destination if erosion_relevant==0
estadd scalar control_mean = r(mean) : est4
estadd scalar control_sd = r(sd) : est4

eststo: mlogit asp_destination erosion_relevant flood_relevant $controls [pweight=weight_erosion], $se
estadd local Weights_flood "No": est5
estadd local Weights_erosion "Yes": est5
quietly sum asp_destination [aweight=weight_erosion] if erosion_relevant==0
estadd scalar control_mean = r(mean) : est5
estadd scalar control_sd = r(sd) : est5

eststo: mlogit asp_destination erosion_relevant flood_relevant $controls [pweight=weight_flood], $se
estadd local Weights_flood "Yes": est6
estadd local Weights_erosion "No": est6
quietly sum asp_destination [aweight=weight_flood] if flood_relevant==0
estadd scalar control_mean = r(mean) : est6
estadd scalar control_sd = r(sd) : est6

esttab, nonotes replace compress stats(N r2_p control_mean control_sd Weights_erosion Weights_flood, fmt(0 2)) b(2) se(2) star(* 0.10 ** 0.05 *** 0.01) label ///
keep(erosion_relevant flood_relevant) indicate( "Controls = 1.sex") ///
note("$sample") 

*
*Table 4, Duration of migration aspirations 
*
eststo clear

eststo: mlogit asp_duration erosion_relevant flood_relevant  , $se
estadd local Weights_flood "No": est1
estadd local Weights_erosion "No": est1
quietly sum asp_duration if erosion_relevant==0
estadd scalar control_mean = r(mean) : est1
estadd scalar control_sd = r(sd) : est1

eststo: mlogit asp_duration erosion_relevant flood_relevant [pweight=weight_erosion], $se
estadd local Weights_flood "No": est2
estadd local Weights_erosion "Yes": est2
quietly sum asp_duration [aweight=weight_erosion] if erosion_relevant==0
estadd scalar control_mean = r(mean) : est2
estadd scalar control_sd = r(sd) : est2

eststo: mlogit asp_duration erosion_relevant flood_relevant [pweight=weight_flood], $se
estadd local Weights_flood "Yes": est3
estadd local Weights_erosion "No": est3
quietly sum asp_duration [aweight=weight_flood] if flood_relevant==0
estadd scalar control_mean = r(mean) : est3
estadd scalar control_sd = r(sd) : est3

eststo: mlogit asp_duration erosion_relevant flood_relevant $controls , $se
estadd local Weights_flood "No": est4
estadd local Weights_erosion "No": est4
quietly sum asp_duration if erosion_relevant==0
estadd scalar control_mean = r(mean) : est4
estadd scalar control_sd = r(sd) : est4

eststo: mlogit asp_duration erosion_relevant flood_relevant $controls [pweight=weight_erosion], $se
estadd local Weights_flood "No": est5
estadd local Weights_erosion "Yes": est5
quietly sum asp_duration [aweight=weight_erosion] if erosion_relevant==0
estadd scalar control_mean = r(mean) : est5
estadd scalar control_sd = r(sd) : est5

eststo: mlogit asp_duration erosion_relevant flood_relevant $controls [pweight=weight_flood], $se
estadd local Weights_flood "Yes": est6
estadd local Weights_erosion "No": est6
quietly sum asp_duration [aweight=weight_flood] if flood_relevant==0
estadd scalar control_mean = r(mean) : est6
estadd scalar control_sd = r(sd) : est6

esttab, nonotes replace compress stats(N r2_p control_mean control_sd Weights_erosion Weights_flood, fmt(0 2)) b(2) se(2) star(* 0.10 ** 0.05 *** 0.01) label ///
keep(erosion_relevant flood_relevant) indicate( "Controls = 1.sex") ///
note("$sample") 
	
****************************************************************************************************************
*\/////////////////////////////////////
*
*Creation of Online Appendix Figures and Tables
*
*\/////////////////////////////////////
****************************************************************************************************************
*Apendix A
****************
*
*Table A.4, Means and t-tests (two-sided) for difference in means
*
eststo clear
eststo erosion: estpost ttest district_num? zone_num? sex age_cat_num? kids_num_type? education_num? income_num? land_size_total housing lsu fullequip risk_pref attachment past_migration1  aspirations_past aspirations_present_all erosion_relevant flood_relevant , by(migrant) 

esttab ///
	, mtitles() replace  compress star(* 0.10 ** 0.05 *** 0.01)  label ///
	cells("mu_1(fmt(%12.2f) label(Nonmigrant)) mu_2(fmt(%12.2f) label(Migrant)) b(fmt(%12.2f) star label(Diff-In-Means)) N_1(fmt(%12.0f) label(N Nonmigrant)) N_2(fmt(%12.0f) label(N Migrant))" "mean mean se(par fmt(2))" ". . .")
	
*
*Table A.5, Cross-tabulation of any self-reported erosion 
*
tab erosion_relevant house_lost , chi2 

*
*Table A.6, Cross-tabulation of self-reported erosion-induced 
*
tab selfreported_loss_house house_lost, chi2 

*
*Table A.7, Balance tests (two-sided t-test) for control vs. treatment group 
*
eststo clear
eststo erosion: estpost ttest district_num? zone_num? sex age_cat_num? kids_num_type? education_num? income_num? land_size_total housing lsu fullequip risk_pref attachment past_migration1  aspirations_past aspirations_present_all  , by(erosion_relevant) 

eststo flood: estpost ttest district_num? zone_num? sex age_cat_num? kids_num_type? education_num? income_num? land_size_total housing lsu fullequip risk_pref attachment past_migration1  aspirations_past aspirations_present_all , by(flood_relevant) 

esttab, mtitles(Erosion Flood) replace  compress star(* 0.10 ** 0.05 *** 0.01)  label ///
	cells("mu_1(fmt(%12.2f) label(C)) mu_2(fmt(%12.2f) label(T)) b(fmt(%12.2f) star label(Diff-In-Means)) N_1(fmt(%12.0f) label(N C)) N_2(fmt(%12.0f) label(N T))" "mean mean se(par fmt(2))" ". . .") ///
	note("Sample: HH that did and did not move within 6 months.")
	
*
*Table A.8, Balance of the erosion treatment and control group before and after the entropy 
*
ebalance erosion_relevant flood_relevant $controls 

*
*Table A.9, Balance of the flood treatment and control group before and after the entropy 
*
ebalance flood_relevant erosion_relevant $controls 
	

****************************************************************************************************************
*Apendix B
********************
*
*Figure B.1, OLS models for present migration aspirations, reduced sample
*
grstyle init
grstyle set imesh
grstyle set color hue, n(6)
grstyle set symbol
grstyle set legend, nobox
grstyle set legend 5, inside nobox

eststo clear 

foreach dv in aspiration_choice aspiration_thought {

eststo `dv'1: reg `dv' erosion_relevant flood_relevant if reduced_sample == 1 , $se
eststo `dv'2: reg `dv' erosion_relevant flood_relevant [pweight=rs_weight_erosion] if reduced_sample == 1, $se
eststo `dv'3: reg `dv' erosion_relevant flood_relevant [pweight=rs_weight_flood] if reduced_sample == 1, $se
eststo `dv'4: reg `dv' erosion_relevant flood_relevant $controls if reduced_sample == 1, $se
eststo `dv'5: reg `dv' erosion_relevant flood_relevant $controls [pweight=rs_weight_erosion] if reduced_sample == 1, $se
eststo `dv'6: reg `dv' erosion_relevant flood_relevant $controls [pweight=rs_weight_flood] if reduced_sample == 1, $se

}

coefplot ///
(aspiration_choice1,  keep(erosion_relevant flood_relevant)) ///
(aspiration_choice2,  keep(erosion_relevant)) ///
(aspiration_choice3,  keep(flood_relevant)) ///
(aspiration_choice4,  keep(erosion_relevant flood_relevant)) ///
(aspiration_choice5,  keep(erosion_relevant)) ///
(aspiration_choice6,  keep(flood_relevant)) ///
, bylabel("Aspirations (now)") ///
|| ///
(aspiration_thought1, label(No weights, no controls) keep (erosion_relevant flood_relevant)) ///
(aspiration_thought2, label(Erosion weights) keep (erosion_relevant)) ///
(aspiration_thought3, label (Flood weights) keep (flood_relevant)) ///
(aspiration_thought4, label(No weights, controls) keep (erosion_relevant flood_relevant)) ///
(aspiration_thought5, label(Erosion weights, controls) keep (erosion_relevant)) ///
(aspiration_thought6, label (Flood weights, controls) keep (flood_relevant)) ///
, bylabel("Aspirations (last month)") ///
 xline(0) label legend(rows(2) size(*0.7)) /// 
 byopts(note("Sample: HH that did not move within 6 months, i.e. exluding temporary and permanent migrants, as well" "as households that 'shifted' within village. Entropy balancing weights and control variables used as" "indicated. Standard errors clustered by village."))

*
*Table B.1a, Last month's migration aspirations and erosion/flood affectedness 
*	
eststo clear

eststo: reg aspiration_thought erosion_relevant flood_relevant  , $se
estadd local Weights_flood "No": est1
estadd local Weights_erosion "No": est1
quietly sum aspiration_thought if erosion_relevant==0
estadd scalar control_mean = r(mean) : est1
estadd scalar control_sd = r(sd) : est1

eststo: reg aspiration_thought erosion_relevant flood_relevant [pweight=weight_erosion], $se
estadd local Weights_flood "No": est2
estadd local Weights_erosion "Yes" : est2
quietly sum aspiration_thought [aweight=weight_erosion] if erosion_relevant==0
estadd scalar control_mean = r(mean) : est2
estadd scalar control_sd = r(sd) : est2

eststo: reg aspiration_thought erosion_relevant flood_relevant [pweight=weight_flood], $se
estadd local Weights_flood "Yes": est3
estadd local Weights_erosion "No": est3
quietly sum aspiration_thought [aweight=weight_flood] if flood_relevant==0
estadd scalar control_mean = r(mean) : est3
estadd scalar control_sd = r(sd) : est3

eststo: reg aspiration_thought erosion_relevant flood_relevant $controls , $se
estadd local Weights_flood "No": est4
estadd local Weights_erosion "No": est4
quietly sum aspiration_thought if erosion_relevant==0
estadd scalar control_mean = r(mean) : est4
estadd scalar control_sd = r(sd) : est4

eststo: reg aspiration_thought erosion_relevant flood_relevant $controls [pweight=weight_erosion], $se
estadd local Weights_flood "No": est5
estadd local Weights_erosion "Yes": est5
quietly sum aspiration_thought [aweight=weight_erosion] if erosion_relevant==0
estadd scalar control_mean = r(mean) : est5
estadd scalar control_sd = r(sd) : est5

eststo: reg aspiration_thought erosion_relevant flood_relevant $controls [pweight=weight_flood], $se
estadd local Weights_flood "Yes": est6
estadd local Weights_erosion "No": est6
quietly sum aspiration_thought [aweight=weight_flood] if flood_relevant==0
estadd scalar control_mean = r(mean) : est6
estadd scalar control_sd = r(sd) : est6

esttab, nonotes replace compress stats(N r2_a control_mean control_sd Weights_erosion Weights_flood, fmt(0 2)) b(2) se(2) star(* 0.10 ** 0.05 *** 0.01) label ///
keep(erosion_relevant flood_relevant) indicate( "Controls = 1.sex") ///
note("$sample") 

*
*Table B.1b, Current migration aspirations and erosion/flood affectedness 
*	
eststo clear

eststo: reg aspiration_choice erosion_relevant flood_relevant  , $se
estadd local Weights_flood "No": est1
estadd local Weights_erosion "No": est1
quietly sum aspiration_choice if erosion_relevant==0
estadd scalar control_mean = r(mean) : est1
estadd scalar control_sd = r(sd) : est1

eststo: reg aspiration_choice erosion_relevant flood_relevant [pweight=weight_erosion], $se
estadd local Weights_flood "No": est2
estadd local Weights_erosion "Yes" : est2
quietly sum aspiration_choice [aweight=weight_erosion] if erosion_relevant==0
estadd scalar control_mean = r(mean) : est2
estadd scalar control_sd = r(sd) : est2

eststo: reg aspiration_choice erosion_relevant flood_relevant [pweight=weight_flood], $se
estadd local Weights_flood "Yes": est3
estadd local Weights_erosion "No": est3
quietly sum aspiration_choice [aweight=weight_flood] if flood_relevant==0
estadd scalar control_mean = r(mean) : est3
estadd scalar control_sd = r(sd) : est3

eststo: reg aspiration_choice erosion_relevant flood_relevant $controls , $se
estadd local Weights_flood "No": est4
estadd local Weights_erosion "No": est4
quietly sum aspiration_choice if erosion_relevant==0
estadd scalar control_mean = r(mean) : est4
estadd scalar control_sd = r(sd) : est4

eststo: reg aspiration_choice erosion_relevant flood_relevant $controls [pweight=weight_erosion], $se
estadd local Weights_flood "No": est5
estadd local Weights_erosion "Yes": est5
quietly sum aspiration_choice [aweight=weight_erosion] if erosion_relevant==0
estadd scalar control_mean = r(mean) : est5
estadd scalar control_sd = r(sd) : est5

eststo: reg aspiration_choice erosion_relevant flood_relevant $controls [pweight=weight_flood], $se
estadd local Weights_flood "Yes": est6
estadd local Weights_erosion "No": est6
quietly sum aspiration_choice [aweight=weight_flood] if flood_relevant==0
estadd scalar control_mean = r(mean) : est6
estadd scalar control_sd = r(sd) : est6

esttab, nonotes replace compress stats(N r2_a control_mean control_sd Weights_erosion Weights_flood, fmt(0 2)) b(2) se(2) star(* 0.10 ** 0.05 *** 0.01) label ///
keep(erosion_relevant flood_relevant) indicate( "Controls = 1.sex") ///
note("$sample") 

*
*Table B.2, Current migration aspirations and erosion/flood affectedness 
*	
eststo clear

eststo: reg aspiration_thought erosion_relevant flood_relevant  , $se
estadd local Weights_flood "No": est1
estadd local Weights_erosion "No": est1
quietly sum aspiration_thought if erosion_relevant==0
estadd scalar control_mean = r(mean) : est1
estadd scalar control_sd = r(sd) : est1

eststo: reg aspiration_thought erosion_relevant flood_relevant [pweight=weight_erosion], $se
estadd local Weights_flood "No": est2
estadd local Weights_erosion "Yes" : est2
quietly sum aspiration_thought [aweight=weight_erosion] if erosion_relevant==0
estadd scalar control_mean = r(mean) : est2
estadd scalar control_sd = r(sd) : est2

eststo: reg aspiration_thought erosion_relevant flood_relevant [pweight=weight_flood], $se
estadd local Weights_flood "Yes": est3
estadd local Weights_erosion "No": est3
quietly sum aspiration_thought [aweight=weight_flood] if flood_relevant==0
estadd scalar control_mean = r(mean) : est3
estadd scalar control_sd = r(sd) : est3

eststo: reg aspiration_thought erosion_relevant flood_relevant $controls , $se
estadd local Weights_flood "No": est4
estadd local Weights_erosion "No": est4
quietly sum aspiration_thought if erosion_relevant==0
estadd scalar control_mean = r(mean) : est4
estadd scalar control_sd = r(sd) : est4

eststo: reg aspiration_thought erosion_relevant flood_relevant $controls [pweight=weight_erosion], $se
estadd local Weights_flood "No": est5
estadd local Weights_erosion "Yes": est5
quietly sum aspiration_thought [aweight=weight_erosion] if erosion_relevant==0
estadd scalar control_mean = r(mean) : est5
estadd scalar control_sd = r(sd) : est5

eststo: reg aspiration_thought erosion_relevant flood_relevant $controls [pweight=weight_flood], $se
estadd local Weights_flood "Yes": est6
estadd local Weights_erosion "No": est6
quietly sum aspiration_thought [aweight=weight_flood] if flood_relevant==0
estadd scalar control_mean = r(mean) : est6
estadd scalar control_sd = r(sd) : est6

esttab, nonotes replace compress stats(N r2_a control_mean control_sd Weights_erosion Weights_flood, fmt(0 2)) b(2) se(2) star(* 0.10 ** 0.05 *** 0.01) label ///
order(erosion_relevant flood_relevant)   ///
note("$sample")		

*
*Table B.3, Current migration aspirations and erosion/flood affectedness 
*
eststo clear

eststo: reg aspiration_choice erosion_relevant flood_relevant  , $se
estadd local Weights_flood "No": est1
estadd local Weights_erosion "No": est1
quietly sum aspiration_choice if erosion_relevant==0
estadd scalar control_mean = r(mean) : est1
estadd scalar control_sd = r(sd) : est1

eststo: reg aspiration_choice erosion_relevant flood_relevant [pweight=weight_erosion], $se
estadd local Weights_flood "No": est2
estadd local Weights_erosion "Yes" : est2
quietly sum aspiration_choice [aweight=weight_erosion] if erosion_relevant==0
estadd scalar control_mean = r(mean) : est2
estadd scalar control_sd = r(sd) : est2

eststo: reg aspiration_choice erosion_relevant flood_relevant [pweight=weight_flood], $se
estadd local Weights_flood "Yes": est3
estadd local Weights_erosion "No": est3
quietly sum aspiration_choice [aweight=weight_flood] if flood_relevant==0
estadd scalar control_mean = r(mean) : est3
estadd scalar control_sd = r(sd) : est3

eststo: reg aspiration_choice erosion_relevant flood_relevant $controls , $se
estadd local Weights_flood "No": est4
estadd local Weights_erosion "No": est4
quietly sum aspiration_choice if erosion_relevant==0
estadd scalar control_mean = r(mean) : est4
estadd scalar control_sd = r(sd) : est4

eststo: reg aspiration_choice erosion_relevant flood_relevant $controls [pweight=weight_erosion], $se
estadd local Weights_flood "No": est5
estadd local Weights_erosion "Yes": est5
quietly sum aspiration_choice [aweight=weight_erosion] if erosion_relevant==0
estadd scalar control_mean = r(mean) : est5
estadd scalar control_sd = r(sd) : est5

eststo: reg aspiration_choice erosion_relevant flood_relevant $controls [pweight=weight_flood], $se
estadd local Weights_flood "Yes": est6
estadd local Weights_erosion "No": est6
quietly sum aspiration_choice [aweight=weight_flood] if flood_relevant==0
estadd scalar control_mean = r(mean) : est6
estadd scalar control_sd = r(sd) : est6

esttab, nonotes replace compress stats(N r2_a control_mean control_sd Weights_erosion Weights_flood, fmt(0 2)) b(2) se(2) star(* 0.10 ** 0.05 *** 0.01) label ///
order(erosion_relevant flood_relevant)   ///
note("$sample")		

*
*Table B.4, Logit models for past migration aspirations
*
eststo clear

eststo: logit aspiration_thought erosion_relevant flood_relevant  , $se
estadd local Weights_flood "No": est1
estadd local Weights_erosion "No": est1
quietly sum aspiration_thought if erosion_relevant==0
estadd scalar control_mean = r(mean) : est1
estadd scalar control_sd = r(sd) : est1

eststo: logit aspiration_thought erosion_relevant flood_relevant [pweight=weight_erosion], $se
estadd local Weights_flood "No": est2
estadd local Weights_erosion "Yes": est2
quietly sum aspiration_thought [aweight=weight_erosion] if erosion_relevant==0
estadd scalar control_mean = r(mean) : est2
estadd scalar control_sd = r(sd) : est2

eststo: logit aspiration_thought erosion_relevant flood_relevant [pweight=weight_flood], $se
estadd local Weights_flood "Yes": est3
estadd local Weights_erosion "No": est3
quietly sum aspiration_thought [aweight=weight_flood] if flood_relevant==0
estadd scalar control_mean = r(mean) : est3
estadd scalar control_sd = r(sd) : est3

eststo: logit aspiration_thought erosion_relevant flood_relevant $controls , $se
estadd local Weights_flood "No": est4
estadd local Weights_erosion "No": est4
quietly sum aspiration_thought if erosion_relevant==0
estadd scalar control_mean = r(mean) : est4
estadd scalar control_sd = r(sd) : est4

eststo: logit aspiration_thought erosion_relevant flood_relevant $controls [pweight=weight_erosion], $se
estadd local Weights_flood "No": est5
estadd local Weights_erosion "Yes": est5
quietly sum aspiration_thought [aweight=weight_erosion] if erosion_relevant==0
estadd scalar control_mean = r(mean) : est5
estadd scalar control_sd = r(sd) : est5

eststo: logit aspiration_thought erosion_relevant flood_relevant $controls [pweight=weight_flood], $se
estadd local Weights_flood "Yes": est6
estadd local Weights_erosion "No": est6
quietly sum aspiration_thought [aweight=weight_flood] if flood_relevant==0
estadd scalar control_mean = r(mean) : est6
estadd scalar control_sd = r(sd) : est6

esttab, nonotes replace compress stats(N r2_p control_mean control_sd Weights_erosion Weights_flood, fmt(0 2)) b(2) se(2) star(* 0.10 ** 0.05 *** 0.01) label ///
keep(erosion_relevant flood_relevant) indicate( "Controls = 1.sex") ///
note("$sample") 

*
*Table B.5, Logit models for present migration aspirations
*
eststo clear

eststo: logit aspiration_choice erosion_relevant flood_relevant  , $se
estadd local Weights_flood "No": est1
estadd local Weights_erosion "No": est1
quietly sum aspiration_choice if erosion_relevant==0
estadd scalar control_mean = r(mean) : est1
estadd scalar control_sd = r(sd) : est1

eststo: logit aspiration_choice erosion_relevant flood_relevant [pweight=weight_erosion], $se
estadd local Weights_flood "No": est2
estadd local Weights_erosion "Yes": est2
quietly sum aspiration_choice [aweight=weight_erosion] if erosion_relevant==0
estadd scalar control_mean = r(mean) : est2
estadd scalar control_sd = r(sd) : est2

eststo: logit aspiration_choice erosion_relevant flood_relevant [pweight=weight_flood], $se
estadd local Weights_flood "Yes": est3
estadd local Weights_erosion "No": est3
quietly sum aspiration_choice [aweight=weight_flood] if flood_relevant==0
estadd scalar control_mean = r(mean) : est3
estadd scalar control_sd = r(sd) : est3

eststo: logit aspiration_choice erosion_relevant flood_relevant $controls , $se
estadd local Weights_flood "No": est4
estadd local Weights_erosion "No": est4
quietly sum aspiration_choice if erosion_relevant==0
estadd scalar control_mean = r(mean) : est4
estadd scalar control_sd = r(sd) : est4

eststo: logit aspiration_choice erosion_relevant flood_relevant $controls [pweight=weight_erosion], $se
estadd local Weights_flood "No": est5
estadd local Weights_erosion "Yes": est5
quietly sum aspiration_choice [aweight=weight_erosion] if erosion_relevant==0
estadd scalar control_mean = r(mean) : est5
estadd scalar control_sd = r(sd) : est5

eststo: logit aspiration_choice erosion_relevant flood_relevant $controls [pweight=weight_flood], $se
estadd local Weights_flood "Yes": est6
estadd local Weights_erosion "No": est6
quietly sum aspiration_choice [aweight=weight_flood] if flood_relevant==0
estadd scalar control_mean = r(mean) : est6
estadd scalar control_sd = r(sd) : est6

esttab, nonotes replace compress stats(N r2_p control_mean control_sd Weights_erosion Weights_flood, fmt(0 2)) b(2) se(2) star(* 0.10 ** 0.05 *** 0.01) label ///
keep(erosion_relevant flood_relevant) indicate( "Controls = 1.sex") ///
note("$sample") 

*
*Table B.6, Logit models for past migration aspirations, by impact extent
* 
eststo clear

eststo: logit aspiration_thought ib4.erosion2021_impactcat ib4.flood2021_impactcat  , $se
estadd local Subgroup_weights_flood "No": est1
estadd local Subgroup_weights_erosion "No": est1
quietly sum aspiration_thought if erosion_relevant==0
estadd scalar control_mean = r(mean) : est1
estadd scalar control_sd = r(sd) : est1

eststo: logit aspiration_thought ib4.erosion2021_impactcat ib4.flood2021_impactcat $controls , $se
estadd local Subgroup_weights_flood "No": est2
estadd local Subgroup_weights_erosion "No": est2
quietly sum aspiration_thought if erosion_relevant==0
estadd scalar control_mean = r(mean) : est2
estadd scalar control_sd = r(sd) : est2

eststo: logit aspiration_thought ib4.erosion2021_impactcat flood_relevant $controls [pweight=weight_erosion_cat1], $se
estadd local Subgroup_weights_flood "No": est3
estadd local Subgroup_weights_erosion "Yes": est3
quietly sum aspiration_thought  [aweight=weight_erosion_cat1] if  erosion_relevant==0
estadd scalar control_mean = r(mean) : est3
estadd scalar control_sd = r(sd) : est3

eststo: logit aspiration_thought ib4.erosion2021_impactcat flood_relevant $controls [pweight=weight_erosion_cat2], $se
estadd local Subgroup_weights_flood "No": est4
estadd local Subgroup_weights_erosion "Yes": est4
quietly sum aspiration_thought  [aweight=weight_erosion_cat2] if  erosion_relevant==0
estadd scalar control_mean = r(mean) : est4
estadd scalar control_sd = r(sd) : est4

eststo: logit aspiration_thought ib4.erosion2021_impactcat flood_relevant $controls [pweight=weight_erosion_cat3], $se
estadd local Subgroup_weights_flood "No": est5
estadd local Subgroup_weights_erosion "Yes": est5
quietly sum aspiration_thought  [aweight=weight_flood_cat1] if erosion_relevant==0
estadd scalar control_mean = r(mean) : est5
estadd scalar control_sd = r(sd) : est5

eststo: logit aspiration_thought  ib4.flood2021_impactcat erosion_relevant $controls [pweight=weight_flood_cat1], $se
estadd local Subgroup_weights_flood "Yes": est6
estadd local Subgroup_weights_erosion "No": est6
quietly sum aspiration_thought [aweight=weight_flood_cat1] if flood_relevant==0
estadd scalar control_mean = r(mean) : est6
estadd scalar control_sd = r(sd) : est6

eststo: logit aspiration_thought  ib4.flood2021_impactcat erosion_relevant $controls [pweight=weight_flood_cat2], $se
estadd local Subgroup_weights_flood "Yes": est7
estadd local Subgroup_weights_erosion "No": est7
quietly sum aspiration_thought [aweight=weight_flood_cat2] if flood_relevant==0
estadd scalar control_mean = r(mean) : est7
estadd scalar control_sd = r(sd) : est7

eststo: logit aspiration_thought  ib4.flood2021_impactcat erosion_relevant $controls [pweight=weight_flood_cat3], $se
estadd local Subgroup_weights_flood "Yes": est8
estadd local Subgroup_weights_erosion "No": est8
quietly sum aspiration_thought [aweight=weight_flood_cat3] if flood_relevant==0
estadd scalar control_mean = r(mean) : est8
estadd scalar control_sd = r(sd) : est8

esttab, nonotes replace compress stats(N r2_p control_mean control_sd Subgroup_weights_flood Subgroup_weights_erosion, fmt(0 2)) b(2) se(2) star(* 0.10 ** 0.05 *** 0.01) label ///
keep(*erosion* *flood*) order(*erosion2021_impactcat) indicate( "Controls = 1.sex") ///
note("$sample") 

*
*Table B.7, Logit models for present migration aspirations, by impact extent
*
eststo clear

eststo: logit aspiration_choice ib4.erosion2021_impactcat ib4.flood2021_impactcat  , $se
estadd local Subgroup_weights_flood "No": est1
estadd local Subgroup_weights_erosion "No": est1
quietly sum aspiration_choice if erosion_relevant==0
estadd scalar control_mean = r(mean) : est1
estadd scalar control_sd = r(sd) : est1

eststo: logit aspiration_choice ib4.erosion2021_impactcat ib4.flood2021_impactcat $controls , $se
estadd local Subgroup_weights_flood "No": est2
estadd local Subgroup_weights_erosion "No": est2
quietly sum aspiration_choice if erosion_relevant==0
estadd scalar control_mean = r(mean) : est2
estadd scalar control_sd = r(sd) : est2

eststo: logit aspiration_choice ib4.erosion2021_impactcat flood_relevant $controls [pweight=weight_erosion_cat1], $se
estadd local Subgroup_weights_flood "No": est3
estadd local Subgroup_weights_erosion "Yes": est3
quietly sum aspiration_choice  [aweight=weight_erosion_cat1] if  erosion_relevant==0
estadd scalar control_mean = r(mean) : est3
estadd scalar control_sd = r(sd) : est3

eststo: logit aspiration_choice ib4.erosion2021_impactcat flood_relevant $controls [pweight=weight_erosion_cat2], $se
estadd local Subgroup_weights_flood "No": est4
estadd local Subgroup_weights_erosion "Yes": est4
quietly sum aspiration_choice  [aweight=weight_erosion_cat2] if  erosion_relevant==0
estadd scalar control_mean = r(mean) : est4
estadd scalar control_sd = r(sd) : est4

eststo: logit aspiration_choice ib4.erosion2021_impactcat flood_relevant $controls [pweight=weight_erosion_cat3], $se
estadd local Subgroup_weights_flood "No": est5
estadd local Subgroup_weights_erosion "Yes": est5
quietly sum aspiration_choice  [aweight=weight_flood_cat1] if erosion_relevant==0
estadd scalar control_mean = r(mean) : est5
estadd scalar control_sd = r(sd) : est5

eststo: logit aspiration_choice  ib4.flood2021_impactcat erosion_relevant $controls [pweight=weight_flood_cat1], $se
estadd local Subgroup_weights_flood "Yes": est6
estadd local Subgroup_weights_erosion "No": est6
quietly sum aspiration_choice [aweight=weight_flood_cat1] if flood_relevant==0
estadd scalar control_mean = r(mean) : est6
estadd scalar control_sd = r(sd) : est6

eststo: logit aspiration_choice  ib4.flood2021_impactcat erosion_relevant $controls [pweight=weight_flood_cat2], $se
estadd local Subgroup_weights_flood "Yes": est7
estadd local Subgroup_weights_erosion "No": est7
quietly sum aspiration_choice [aweight=weight_flood_cat2] if flood_relevant==0
estadd scalar control_mean = r(mean) : est7
estadd scalar control_sd = r(sd) : est7

eststo: logit aspiration_choice  ib4.flood2021_impactcat erosion_relevant $controls [pweight=weight_flood_cat3], $se
estadd local Subgroup_weights_flood "Yes": est8
estadd local Subgroup_weights_erosion "No": est8
quietly sum aspiration_choice [aweight=weight_flood_cat3] if flood_relevant==0
estadd scalar control_mean = r(mean) : est8
estadd scalar control_sd = r(sd) : est8

esttab, nonotes replace compress stats(N r2_p control_mean control_sd Subgroup_weights_flood Subgroup_weights_erosion, fmt(0 2)) b(2) se(2) star(* 0.10 ** 0.05 *** 0.01) label ///
keep(*erosion* *flood*) order(*erosion2021_impactcat) indicate( "Controls = 1.sex") ///
note("$sample")
 
*
*Table B.8, OLS models for present migration aspirations, reduced sample
*
eststo clear

eststo: reg aspiration_choice erosion_relevant flood_relevant if reduced_sample == 1 , $se
estadd local Weights_flood "No": est1
estadd local Weights_erosion "No": est1
quietly sum aspiration_choice if erosion_relevant==0 &  reduced_sample == 1
estadd scalar control_mean = r(mean) : est1
estadd scalar control_sd = r(sd) : est1

eststo: reg aspiration_choice erosion_relevant flood_relevant [pweight=rs_weight_erosion] if reduced_sample == 1, $se
estadd local Weights_flood "No": est2
estadd local Weights_erosion "Yes" : est2
quietly sum aspiration_choice [aweight=rs_weight_erosion] if erosion_relevant==0 &  reduced_sample == 1
estadd scalar control_mean = r(mean) : est2
estadd scalar control_sd = r(sd) : est2

eststo: reg aspiration_choice erosion_relevant flood_relevant [pweight=rs_weight_flood] if reduced_sample == 1, $se
estadd local Weights_flood "Yes": est3
estadd local Weights_erosion "No": est3
quietly sum aspiration_choice [aweight=rs_weight_flood] if flood_relevant==0 &  reduced_sample == 1
estadd scalar control_mean = r(mean) : est3
estadd scalar control_sd = r(sd) : est3

eststo: reg aspiration_choice erosion_relevant flood_relevant $controls if  reduced_sample == 1, $se
estadd local Weights_flood "No": est4
estadd local Weights_erosion "No": est4
quietly sum aspiration_choice if erosion_relevant==0 &  reduced_sample == 1
estadd scalar control_mean = r(mean) : est4
estadd scalar control_sd = r(sd) : est4

eststo: reg aspiration_choice erosion_relevant flood_relevant $controls [pweight=rs_weight_erosion] if reduced_sample == 1, $se
estadd local Weights_flood "No": est5
estadd local Weights_erosion "Yes": est5
quietly sum aspiration_choice [aweight=rs_weight_erosion] if erosion_relevant==0 &  reduced_sample == 1
estadd scalar control_mean = r(mean) : est5
estadd scalar control_sd = r(sd) : est5

eststo: reg aspiration_choice erosion_relevant flood_relevant $controls [pweight=rs_weight_flood] if reduced_sample == 1, $se
estadd local Weights_flood "Yes": est6
estadd local Weights_erosion "No": est6
quietly sum aspiration_choice [aweight=rs_weight_flood] if flood_relevant==0 &  reduced_sample == 1
estadd scalar control_mean = r(mean) : est6
estadd scalar control_sd = r(sd) : est6

esttab, nonotes replace compress stats(N r2_a control_mean control_sd Weights_erosion Weights_flood, fmt(0 2)) b(2) se(2) star(* 0.10 ** 0.05 *** 0.01) label ///
keep(erosion_relevant flood_relevant) indicate( "Controls = 1.sex") ///
note("$reduced_sample_text") 

*
*Table B.9, OLS models for past migration aspirations, reduced sample
*
eststo clear

eststo: reg aspiration_thought erosion_relevant flood_relevant if reduced_sample == 1 , $se
estadd local Weights_flood "No": est1
estadd local Weights_erosion "No": est1
quietly sum aspiration_thought if erosion_relevant==0 &  reduced_sample == 1
estadd scalar control_mean = r(mean) : est1
estadd scalar control_sd = r(sd) : est1

eststo: reg aspiration_thought erosion_relevant flood_relevant [pweight=rs_weight_erosion] if reduced_sample == 1, $se
estadd local Weights_flood "No": est2
estadd local Weights_erosion "Yes" : est2
quietly sum aspiration_thought [aweight=rs_weight_erosion] if erosion_relevant==0 &  reduced_sample == 1
estadd scalar control_mean = r(mean) : est2
estadd scalar control_sd = r(sd) : est2

eststo: reg aspiration_thought erosion_relevant flood_relevant [pweight=rs_weight_flood] if reduced_sample == 1, $se
estadd local Weights_flood "Yes": est3
estadd local Weights_erosion "No": est3
quietly sum aspiration_thought [aweight=rs_weight_flood] if flood_relevant==0 &  reduced_sample == 1
estadd scalar control_mean = r(mean) : est3
estadd scalar control_sd = r(sd) : est3

eststo: reg aspiration_thought erosion_relevant flood_relevant $controls if reduced_sample == 1, $se
estadd local Weights_flood "No": est4
estadd local Weights_erosion "No": est4
quietly sum aspiration_thought if erosion_relevant==0 &  reduced_sample == 1
estadd scalar control_mean = r(mean) : est4
estadd scalar control_sd = r(sd) : est4

eststo: reg aspiration_thought erosion_relevant flood_relevant $controls [pweight=rs_weight_erosion] if reduced_sample == 1, $se
estadd local Weights_flood "No": est5
estadd local Weights_erosion "Yes": est5
quietly sum aspiration_thought [aweight=rs_weight_erosion] if erosion_relevant==0 &  reduced_sample == 1
estadd scalar control_mean = r(mean) : est5
estadd scalar control_sd = r(sd) : est5

eststo: reg aspiration_thought erosion_relevant flood_relevant $controls [pweight=rs_weight_flood] if reduced_sample == 1, $se
estadd local Weights_flood "Yes": est6
estadd local Weights_erosion "No": est6
quietly sum aspiration_thought [aweight=rs_weight_flood] if flood_relevant==0 &  reduced_sample == 1
estadd scalar control_mean = r(mean) : est6
estadd scalar control_sd = r(sd) : est6

esttab, nonotes replace compress stats(N r2_a control_mean control_sd Weights_erosion Weights_flood, fmt(0 2)) b(2) se(2) star(* 0.10 ** 0.05 *** 0.01) label ///
keep(erosion_relevant flood_relevant) indicate( "Controls = 1.sex") ///
note("$reduced_sample_text") 

*
*Table B.10, OLS models for present migration aspirations, reduced sample, by impact extent
*
eststo clear

eststo: reg aspiration_choice ib4.erosion2021_impactcat ib4.flood2021_impactcat if reduced_sample == 1 , $se
estadd local Subgroup_weights_flood "No": est1
estadd local Subgroup_weights_erosion "No": est1
quietly sum aspiration_choice if erosion_relevant==0
estadd scalar control_mean = r(mean) : est1
estadd scalar control_sd = r(sd) : est1

eststo: reg aspiration_choice ib4.erosion2021_impactcat ib4.flood2021_impactcat $controls if reduced_sample == 1, $se
estadd local Subgroup_weights_flood "No": est2
estadd local Subgroup_weights_erosion "No": est2
quietly sum aspiration_choice if erosion_relevant==0 & reduced_sample == 1
estadd scalar control_mean = r(mean) : est2
estadd scalar control_sd = r(sd) : est2

eststo: reg aspiration_choice ib4.erosion2021_impactcat flood_relevant $controls [pweight=rs_weight_erosion_cat1] if reduced_sample == 1, $se
estadd local Subgroup_weights_flood "No": est3
estadd local Subgroup_weights_erosion "Yes": est3
quietly sum aspiration_choice  [aweight=rs_weight_erosion_cat1] if  erosion_relevant==0 & reduced_sample == 1
estadd scalar control_mean = r(mean) : est3
estadd scalar control_sd = r(sd) : est3

eststo: reg aspiration_choice ib4.erosion2021_impactcat flood_relevant $controls [pweight=rs_weight_erosion_cat2] if reduced_sample == 1, $se
estadd local Subgroup_weights_flood "No": est4
estadd local Subgroup_weights_erosion "Yes": est4
quietly sum aspiration_choice  [aweight=rs_weight_erosion_cat2] if  erosion_relevant==0 & reduced_sample == 1
estadd scalar control_mean = r(mean) : est4
estadd scalar control_sd = r(sd) : est4

eststo: reg aspiration_choice ib4.erosion2021_impactcat flood_relevant $controls [pweight=rs_weight_erosion_cat3] if reduced_sample == 1, $se
estadd local Subgroup_weights_flood "No": est5
estadd local Subgroup_weights_erosion "Yes": est5
quietly sum aspiration_choice  [aweight=rs_weight_flood_cat1] if erosion_relevant==0 & reduced_sample == 1
estadd scalar control_mean = r(mean) : est5
estadd scalar control_sd = r(sd) : est5

eststo: reg aspiration_choice  ib4.flood2021_impactcat erosion_relevant $controls [pweight=rs_weight_flood_cat1] if reduced_sample == 1, $se
estadd local Subgroup_weights_flood "Yes": est6
estadd local Subgroup_weights_erosion "No": est6
quietly sum aspiration_choice [aweight=rs_weight_flood_cat1] if flood_relevant==0 & reduced_sample == 1
estadd scalar control_mean = r(mean) : est6
estadd scalar control_sd = r(sd) : est6

eststo: reg aspiration_choice  ib4.flood2021_impactcat erosion_relevant $controls [pweight=rs_weight_flood_cat2] if reduced_sample == 1, $se
estadd local Subgroup_weights_flood "Yes": est7
estadd local Subgroup_weights_erosion "No": est7
quietly sum aspiration_choice [aweight=rs_weight_flood_cat2] if flood_relevant==0 & reduced_sample == 1
estadd scalar control_mean = r(mean) : est7
estadd scalar control_sd = r(sd) : est7

eststo: reg aspiration_choice  ib4.flood2021_impactcat erosion_relevant $controls [pweight=rs_weight_flood_cat3] if reduced_sample == 1, $se
estadd local Subgroup_weights_flood "Yes": est8
estadd local Subgroup_weights_erosion "No": est8
quietly sum aspiration_choice [aweight=rs_weight_flood_cat3] if flood_relevant==0 & reduced_sample == 1
estadd scalar control_mean = r(mean) : est8
estadd scalar control_sd = r(sd) : est8

esttab, nonotes replace compress stats(N r2_a control_mean control_sd Subgroup_weights_flood Subgroup_weights_erosion, fmt(0 2)) b(2) se(2) star(* 0.10 ** 0.05 *** 0.01) label ///
keep(*erosion* *flood*) order(*erosion2021_impactcat) indicate( "Controls = 1.sex") ///
note("$reduced_sample_text") 

*
*Table B.11, OLS models for past migration aspirations, reduced sample, by impact extent
*
eststo clear

eststo: reg aspiration_thought ib4.erosion2021_impactcat ib4.flood2021_impactcat if reduced_sample == 1 , $se
estadd local Subgroup_weights_flood "No": est1
estadd local Subgroup_weights_erosion "No": est1
quietly sum aspiration_thought if erosion_relevant==0
estadd scalar control_mean = r(mean) : est1
estadd scalar control_sd = r(sd) : est1

eststo: reg aspiration_thought ib4.erosion2021_impactcat ib4.flood2021_impactcat $controls if reduced_sample == 1, $se
estadd local Subgroup_weights_flood "No": est2
estadd local Subgroup_weights_erosion "No": est2
quietly sum aspiration_thought if erosion_relevant==0 & reduced_sample == 1
estadd scalar control_mean = r(mean) : est2
estadd scalar control_sd = r(sd) : est2

eststo: reg aspiration_thought ib4.erosion2021_impactcat flood_relevant $controls [pweight=rs_weight_erosion_cat1] if reduced_sample == 1, $se
estadd local Subgroup_weights_flood "No": est3
estadd local Subgroup_weights_erosion "Yes": est3
quietly sum aspiration_thought  [aweight=rs_weight_erosion_cat1] if  erosion_relevant==0 & reduced_sample == 1
estadd scalar control_mean = r(mean) : est3
estadd scalar control_sd = r(sd) : est3

eststo: reg aspiration_thought ib4.erosion2021_impactcat flood_relevant $controls [pweight=rs_weight_erosion_cat2] if reduced_sample == 1, $se
estadd local Subgroup_weights_flood "No": est4
estadd local Subgroup_weights_erosion "Yes": est4
quietly sum aspiration_thought  [aweight=rs_weight_erosion_cat2] if  erosion_relevant==0 & reduced_sample == 1
estadd scalar control_mean = r(mean) : est4
estadd scalar control_sd = r(sd) : est4

eststo: reg aspiration_thought ib4.erosion2021_impactcat flood_relevant $controls [pweight=rs_weight_erosion_cat3] if reduced_sample == 1, $se
estadd local Subgroup_weights_flood "No": est5
estadd local Subgroup_weights_erosion "Yes": est5
quietly sum aspiration_thought  [aweight=rs_weight_flood_cat1] if erosion_relevant==0 & reduced_sample == 1
estadd scalar control_mean = r(mean) : est5
estadd scalar control_sd = r(sd) : est5

eststo: reg aspiration_thought  ib4.flood2021_impactcat erosion_relevant $controls [pweight=rs_weight_flood_cat1] if reduced_sample == 1, $se
estadd local Subgroup_weights_flood "Yes": est6
estadd local Subgroup_weights_erosion "No": est6
quietly sum aspiration_thought [aweight=rs_weight_flood_cat1] if flood_relevant==0 & reduced_sample == 1
estadd scalar control_mean = r(mean) : est6
estadd scalar control_sd = r(sd) : est6

eststo: reg aspiration_thought  ib4.flood2021_impactcat erosion_relevant $controls [pweight=rs_weight_flood_cat2] if reduced_sample == 1, $se
estadd local Subgroup_weights_flood "Yes": est7
estadd local Subgroup_weights_erosion "No": est7
quietly sum aspiration_thought [aweight=rs_weight_flood_cat2] if flood_relevant==0 & reduced_sample == 1
estadd scalar control_mean = r(mean) : est7
estadd scalar control_sd = r(sd) : est7

eststo: reg aspiration_thought  ib4.flood2021_impactcat erosion_relevant $controls [pweight=rs_weight_flood_cat3] if reduced_sample == 1, $se
estadd local Subgroup_weights_flood "Yes": est8
estadd local Subgroup_weights_erosion "No": est8
quietly sum aspiration_thought [aweight=rs_weight_flood_cat3] if flood_relevant==0 & reduced_sample == 1
estadd scalar control_mean = r(mean) : est8
estadd scalar control_sd = r(sd) : est8

esttab, nonotes replace compress stats(N r2_a control_mean control_sd Subgroup_weights_flood Subgroup_weights_erosion, fmt(0 2)) b(2) se(2) star(* 0.10 ** 0.05 *** 0.01) label ///
keep(*erosion* *flood*) order(*erosion2021_impactcat) indicate( "Controls = 1.sex") ///
note("$reduced_sample_text") 

*
*Table B.12, Multinomial logit for destination, reduced sample
*
eststo clear

eststo: mlogit asp_destination erosion_relevant flood_relevant  if reduced_sample == 1 , $se
estadd local Weights_flood "No": est1
estadd local Weights_erosion "No": est1
quietly sum asp_destination if erosion_relevant==0 & reduced_sample == 1
estadd scalar control_mean = r(mean) : est1
estadd scalar control_sd = r(sd) : est1

eststo: mlogit asp_destination erosion_relevant flood_relevant [pweight=rs_weight_erosion]  if reduced_sample == 1, $se
estadd local Weights_flood "No": est2
estadd local Weights_erosion "Yes": est2
quietly sum asp_destination [aweight=rs_weight_erosion] if erosion_relevant==0 & reduced_sample == 1
estadd scalar control_mean = r(mean) : est2
estadd scalar control_sd = r(sd) : est2

eststo: mlogit asp_destination erosion_relevant flood_relevant [pweight=rs_weight_flood]  if reduced_sample == 1, $se
estadd local Weights_flood "Yes": est3
estadd local Weights_erosion "No": est3
quietly sum asp_destination [aweight=rs_weight_flood] if flood_relevant==0 & reduced_sample == 1
estadd scalar control_mean = r(mean) : est3
estadd scalar control_sd = r(sd) : est3

eststo: mlogit asp_destination erosion_relevant flood_relevant $controls  if reduced_sample == 1, $se
estadd local Weights_flood "No": est4
estadd local Weights_erosion "No": est4
quietly sum asp_destination if erosion_relevant==0 & reduced_sample == 1
estadd scalar control_mean = r(mean) : est4
estadd scalar control_sd = r(sd) : est4

eststo: mlogit asp_destination erosion_relevant flood_relevant $controls [pweight=rs_weight_erosion]  if reduced_sample == 1, $se
estadd local Weights_flood "No": est5
estadd local Weights_erosion "Yes": est5
quietly sum asp_destination [aweight=rs_weight_erosion] if erosion_relevant==0 & reduced_sample == 1
estadd scalar control_mean = r(mean) : est5
estadd scalar control_sd = r(sd) : est5

eststo: mlogit asp_destination erosion_relevant flood_relevant $controls [pweight=rs_weight_flood] if reduced_sample == 1, $se
estadd local Weights_flood "Yes": est6
estadd local Weights_erosion "No": est6
quietly sum asp_destination [aweight=rs_weight_flood] if flood_relevant==0 & reduced_sample == 1
estadd scalar control_mean = r(mean) : est6
estadd scalar control_sd = r(sd) : est6

esttab, nonotes replace compress stats(N r2_p control_mean control_sd Weights_erosion Weights_flood, fmt(0 2)) b(2) se(2) star(* 0.10 ** 0.05 *** 0.01) label ///
keep(erosion_relevant flood_relevant) indicate( "Controls = 1.sex") ///
note("$reduced_sample_text") 

*
*Table B.13, Multinomial logit for duration, reduced sample
*
eststo clear

eststo: mlogit asp_duration erosion_relevant flood_relevant  if reduced_sample == 1 , $se
estadd local Weights_flood "No": est1
estadd local Weights_erosion "No": est1
quietly sum asp_duration if erosion_relevant==0 & reduced_sample == 1
estadd scalar control_mean = r(mean) : est1
estadd scalar control_sd = r(sd) : est1

eststo: mlogit asp_duration erosion_relevant flood_relevant [pweight=rs_weight_erosion]  if reduced_sample == 1, $se
estadd local Weights_flood "No": est2
estadd local Weights_erosion "Yes": est2
quietly sum asp_duration [aweight=rs_weight_erosion] if erosion_relevant==0 & reduced_sample == 1
estadd scalar control_mean = r(mean) : est2
estadd scalar control_sd = r(sd) : est2

eststo: mlogit asp_duration erosion_relevant flood_relevant [pweight=rs_weight_flood]  if reduced_sample == 1, $se
estadd local Weights_flood "Yes": est3
estadd local Weights_erosion "No": est3
quietly sum asp_duration [aweight=rs_weight_flood] if flood_relevant==0 & reduced_sample == 1
estadd scalar control_mean = r(mean) : est3
estadd scalar control_sd = r(sd) : est3

eststo: mlogit asp_duration erosion_relevant flood_relevant $controls  if reduced_sample == 1, $se
estadd local Weights_flood "No": est4
estadd local Weights_erosion "No": est4
quietly sum asp_duration if erosion_relevant==0 & reduced_sample == 1
estadd scalar control_mean = r(mean) : est4
estadd scalar control_sd = r(sd) : est4

eststo: mlogit asp_duration erosion_relevant flood_relevant $controls [pweight=rs_weight_erosion]  if reduced_sample == 1, $se
estadd local Weights_flood "No": est5
estadd local Weights_erosion "Yes": est5
quietly sum asp_duration [aweight=rs_weight_erosion] if erosion_relevant==0 & reduced_sample == 1
estadd scalar control_mean = r(mean) : est5
estadd scalar control_sd = r(sd) : est5

eststo: mlogit asp_duration erosion_relevant flood_relevant $controls [pweight=rs_weight_flood] if reduced_sample == 1, $se
estadd local Weights_flood "Yes": est6
estadd local Weights_erosion "No": est6
quietly sum asp_duration [aweight=rs_weight_flood] if flood_relevant==0 & reduced_sample == 1
estadd scalar control_mean = r(mean) : est6
estadd scalar control_sd = r(sd) : est6

esttab, nonotes replace compress stats(N r2_p control_mean control_sd Weights_erosion Weights_flood, fmt(0 2)) b(2) se(2) star(* 0.10 ** 0.05 *** 0.01) label ///
keep(erosion_relevant flood_relevant) indicate( "Controls = 1.sex") ///
note("$reduced_sample_text") 


*
*Table B.14, Impact of objective erosion impact on last month's migration aspirations
*
eststo clear

eststo est1: reg aspiration_thought ib5.impact_erosion  flood_relevant  , $se
estadd local Weights_objective "No": est1
quietly sum aspiration_thought if impact_erosion==5
estadd scalar control_mean = r(mean) : est1
estadd scalar control_sd = r(sd) : est1

eststo est2: reg aspiration_thought ib5.impact_erosion  flood_relevant [pweight=weight_objectivev2], $se
estadd local Weights_objective "Yes" : est2
quietly sum aspiration_thought [aweight=weight_objective] if impact_erosion==5
estadd scalar control_mean = r(mean) : est2
estadd scalar control_sd = r(sd) : est2

eststo est4: reg aspiration_thought ib5.impact_erosion  flood_relevant $controls , $se
estadd local Weights_objective "No": est4
quietly sum aspiration_thought if impact_erosion==5
estadd scalar control_mean = r(mean) : est4
estadd scalar control_sd = r(sd) : est4

eststo est5: reg aspiration_thought ib5.impact_erosion  flood_relevant $controls [pweight=weight_objectivev2], $se
estadd local Weights_objective "Yes": est5
quietly sum aspiration_thought [aweight=weight_objective] if impact_erosion==5
estadd scalar control_mean = r(mean) : est5
estadd scalar control_sd = r(sd) : est5


esttab, nonotes replace compress stats(N r2_a control_mean control_sd Weights_objective, fmt(0 2)) b(2) se(2) star(* 0.10 ** 0.05 *** 0.01) label ///
keep(*.impact_erosion  flood_relevant) indicate( "Controls = 1.sex") ///
note("$sample") 

*
*Table B.15, Impact of objective erosion impact on current migration aspirations 
*
eststo clear

eststo est1: reg aspiration_choice ib5.impact_erosion  flood_relevant  , $se
estadd local Weights_objective "No": est1
quietly sum aspiration_choice if impact_erosion==5
estadd scalar control_mean = r(mean) : est1
estadd scalar control_sd = r(sd) : est1

eststo est2: reg aspiration_choice ib5.impact_erosion  flood_relevant [pweight=weight_objectivev2], $se
estadd local Weights_objective "Yes" : est2
quietly sum aspiration_choice [aweight=weight_objective] if impact_erosion==5
estadd scalar control_mean = r(mean) : est2
estadd scalar control_sd = r(sd) : est2

eststo est4: reg aspiration_choice ib5.impact_erosion  flood_relevant $controls , $se
estadd local Weights_objective "No": est4
quietly sum aspiration_choice if impact_erosion==5
estadd scalar control_mean = r(mean) : est4
estadd scalar control_sd = r(sd) : est4

eststo est5: reg aspiration_choice ib5.impact_erosion  flood_relevant $controls [pweight=weight_objectivev2], $se
estadd local Weights_objective "Yes": est5
quietly sum aspiration_choice [aweight=weight_objective] if impact_erosion==5
estadd scalar control_mean = r(mean) : est5
estadd scalar control_sd = r(sd) : est5


esttab, nonotes replace compress stats(N r2_a control_mean control_sd Weights_objective, fmt(0 2)) b(2) se(2) star(* 0.10 ** 0.05 *** 0.01) label ///
keep(*.impact_erosion  flood_relevant) indicate( "Controls = 1.sex") ///
note("$sample") 

*
*Table B.16, OLS models for present migration aspirations, full sample, controlling for village level affectedness
*
eststo clear

eststo: reg aspiration_choice erosion_relevant flood_relevant erosion_village2 flood_village2 , $se
estadd local Weights "No"
quietly sum aspiration_choice if erosion_relevant==0 & erosion_village2 < 0.2
estadd scalar control_mean = r(mean) : est1
estadd scalar control_sd = r(sd) : est1

eststo: reg aspiration_choice erosion_relevant flood_relevant erosion_village2 flood_village2 $controls , $se
estadd local Weights "No"
quietly sum aspiration_choice if erosion_relevant==0 & erosion_village2 < 0.2
estadd scalar control_mean = r(mean) : est2
estadd scalar control_sd = r(sd) : est2

eststo: reg aspiration_choice erosion_relevant flood_relevant i.erosion_village_extent2 i.flood_village_extent2 , $se
estadd local Weights "No"
quietly sum aspiration_choice if erosion_relevant==0 & erosion_village2 < 0.2
estadd scalar control_mean = r(mean) : est3
estadd scalar control_sd = r(sd) : est3

eststo: reg aspiration_choice erosion_relevant flood_relevant i.erosion_village_extent2 i.flood_village_extent2 $controls , $se
estadd local Weights "No"
quietly sum aspiration_choice if erosion_relevant==0 & erosion_village2 < 0.2
estadd scalar control_mean = r(mean) : est4
estadd scalar control_sd = r(sd) : est4

esttab, nonotes replace compress stats(N r2_a control_mean control_sd Weights, fmt(0 2)) b(2) se(2) star(* 0.10 ** 0.05 *** 0.01) label ///
keep(*erosion* *flood*) indicate( "Controls = 1.sex") ///
note("$sample") 

*
*Table B.17, OLS models for past migration aspirations, full sample, controlling for village level affectedness
*
eststo clear

eststo: reg aspiration_thought erosion_relevant flood_relevant erosion_village2 flood_village2 , $se
estadd local Weights "No"
quietly sum aspiration_thought if erosion_relevant==0 & erosion_village2 < 0.2
estadd scalar control_mean = r(mean) : est1
estadd scalar control_sd = r(sd) : est1

eststo: reg aspiration_thought erosion_relevant flood_relevant erosion_village2 flood_village2 $controls , $se
estadd local Weights "No"
quietly sum aspiration_thought if erosion_relevant==0 & erosion_village2 < 0.2
estadd scalar control_mean = r(mean) : est2
estadd scalar control_sd = r(sd) : est2

eststo: reg aspiration_thought erosion_relevant flood_relevant i.erosion_village_extent2 i.flood_village_extent2 , $se
estadd local Weights "No"
quietly sum aspiration_thought if erosion_relevant==0 & erosion_village2 < 0.2
estadd scalar control_mean = r(mean) : est3
estadd scalar control_sd = r(sd) : est3

eststo: reg aspiration_thought erosion_relevant flood_relevant i.erosion_village_extent2 i.flood_village_extent2 $controls , $se
estadd local Weights "No"
quietly sum aspiration_thought if erosion_relevant==0 & erosion_village2 < 0.2
estadd scalar control_mean = r(mean) : est4
estadd scalar control_sd = r(sd) : est4

esttab, nonotes replace compress stats(N r2_a control_mean control_sd Weights, fmt(0 2)) b(2) se(2) star(* 0.10 ** 0.05 *** 0.01) label ///
keep(*erosion* *flood*) indicate( "Controls = 1.sex") ///
note("$sample") 

*
*Table B.18, OLS models for present migration aspirations, full sample, recoding respondents with shifting aspirations to zero aspirations
* 
eststo clear

eststo: reg aspiration_choice_noshifters erosion_relevant flood_relevant  , $se
estadd local Weights_flood "No": est1
estadd local Weights_erosion "No": est1
quietly sum aspiration_choice_noshifters if erosion_relevant==0
estadd scalar control_mean = r(mean) : est1
estadd scalar control_sd = r(sd) : est1

eststo: reg aspiration_choice_noshifters erosion_relevant flood_relevant [pweight=weight_erosion], $se
estadd local Weights_flood "No": est2
estadd local Weights_erosion "Yes" : est2
quietly sum aspiration_choice_noshifters [aweight=weight_erosion] if erosion_relevant==0
estadd scalar control_mean = r(mean) : est2
estadd scalar control_sd = r(sd) : est2

eststo: reg aspiration_choice_noshifters erosion_relevant flood_relevant [pweight=weight_flood], $se
estadd local Weights_flood "Yes": est3
estadd local Weights_erosion "No": est3
quietly sum aspiration_choice_noshifters [aweight=weight_flood] if flood_relevant==0
estadd scalar control_mean = r(mean) : est3
estadd scalar control_sd = r(sd) : est3

eststo: reg aspiration_choice_noshifters erosion_relevant flood_relevant $controls , $se
estadd local Weights_flood "No": est4
estadd local Weights_erosion "No": est4
quietly sum aspiration_choice_noshifters if erosion_relevant==0
estadd scalar control_mean = r(mean) : est4
estadd scalar control_sd = r(sd) : est4

eststo: reg aspiration_choice_noshifters erosion_relevant flood_relevant $controls [pweight=weight_erosion], $se
estadd local Weights_flood "No": est5
estadd local Weights_erosion "Yes": est5
quietly sum aspiration_choice_noshifters [aweight=weight_erosion] if erosion_relevant==0
estadd scalar control_mean = r(mean) : est5
estadd scalar control_sd = r(sd) : est5

eststo: reg aspiration_choice_noshifters erosion_relevant flood_relevant $controls [pweight=weight_flood], $se
estadd local Weights_flood "Yes": est6
estadd local Weights_erosion "No": est6
quietly sum aspiration_choice_noshifters [aweight=weight_flood] if flood_relevant==0
estadd scalar control_mean = r(mean) : est6
estadd scalar control_sd = r(sd) : est6

esttab, nonotes replace compress stats(N r2_a control_mean control_sd Weights_erosion Weights_flood, fmt(0 2)) b(2) se(2) star(* 0.10 ** 0.05 *** 0.01) label ///
keep(erosion_relevant flood_relevant) indicate( "Controls = 1.sex") ///
note("$sample". Aspirations recoded to zero if respondent indicates within-village shifting aspirations.) 

*
*Table B.19, OLS models for past migration aspirations, full sample, recoding respondents with shifting aspirations to zero aspirations
*
eststo clear

eststo: reg aspiration_thought_noshifters erosion_relevant flood_relevant  , $se
estadd local Weights_flood "No": est1
estadd local Weights_erosion "No": est1
quietly sum aspiration_thought_noshifters if erosion_relevant==0
estadd scalar control_mean = r(mean) : est1
estadd scalar control_sd = r(sd) : est1

eststo: reg aspiration_thought_noshifters erosion_relevant flood_relevant [pweight=weight_erosion], $se
estadd local Weights_flood "No": est2
estadd local Weights_erosion "Yes" : est2
quietly sum aspiration_thought_noshifters [aweight=weight_erosion] if erosion_relevant==0
estadd scalar control_mean = r(mean) : est2
estadd scalar control_sd = r(sd) : est2

eststo: reg aspiration_thought_noshifters erosion_relevant flood_relevant [pweight=weight_flood], $se
estadd local Weights_flood "Yes": est3
estadd local Weights_erosion "No": est3
quietly sum aspiration_thought_noshifters [aweight=weight_flood] if flood_relevant==0
estadd scalar control_mean = r(mean) : est3
estadd scalar control_sd = r(sd) : est3

eststo: reg aspiration_thought_noshifters erosion_relevant flood_relevant $controls , $se
estadd local Weights_flood "No": est4
estadd local Weights_erosion "No": est4
quietly sum aspiration_thought_noshifters if erosion_relevant==0
estadd scalar control_mean = r(mean) : est4
estadd scalar control_sd = r(sd) : est4

eststo: reg aspiration_thought_noshifters erosion_relevant flood_relevant $controls [pweight=weight_erosion], $se
estadd local Weights_flood "No": est5
estadd local Weights_erosion "Yes": est5
quietly sum aspiration_thought_noshifters [aweight=weight_erosion] if erosion_relevant==0
estadd scalar control_mean = r(mean) : est5
estadd scalar control_sd = r(sd) : est5

eststo: reg aspiration_thought_noshifters erosion_relevant flood_relevant $controls [pweight=weight_flood], $se
estadd local Weights_flood "Yes": est6
estadd local Weights_erosion "No": est6
quietly sum aspiration_thought_noshifters [aweight=weight_flood] if flood_relevant==0
estadd scalar control_mean = r(mean) : est6
estadd scalar control_sd = r(sd) : est6

esttab, nonotes replace compress stats(N r2_a control_mean control_sd Weights_erosion Weights_flood, fmt(0 2)) b(2) se(2) star(* 0.10 ** 0.05 *** 0.01) label ///
keep(erosion_relevant flood_relevant) indicate( "Controls = 1.sex") ///
note("$sample". Aspirations recoded to zero if respondent indicates within-village shifting aspirations.) 

*
*Table B.20, Summary statistics for all major variables
*
eststo clear
estpost summarize migrant house_shifting_within_village shifting_aspiration aspiration_thought aspiration_choice erosion_relevant flood_relevant erosion2021_impactcat_num? flood2021_impactcat_num? erosion_village flood_village  asp_duration_num? asp_destination_num? district_num? zone_num? sex age_cat_num? kids_num_type? education_num? income_num? attachment past_migration1 aspirations_past aspirations_present_all risk_pref land_size_total housing lsu fullequip , 
esttab /// 
, cells("mean sd min max count") nomtitle nonumber label	
